package org.example.controller;

import jakarta.annotation.Resource;
import org.example.service.StoreService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/store")
public class StoreController {
    @Resource
    private StoreService storeService;
    @RequestMapping("/educt")
    public String deduct(@RequestParam("commodityCode") String commodityCode,
                         @RequestParam("orderCount") int orderCount)
    {
        storeService.deduct(commodityCode, orderCount);
        return "success";
    }
}
